﻿using System;
using Microsoft.Extensions.Configuration;

namespace JsonConfigSample
{
    class Program
    {
        static void Main(string[] args)
        {
            var build = new ConfigurationBuilder()
                .AddJsonFile("class.json");

            var config = build.Build();

            Console.WriteLine($"ClassNo {config["ClassNo"]}");
            Console.WriteLine($"ClassName {config["ClassName"]}");
            Console.WriteLine("Students:");
            Console.WriteLine(config["Student:0:name"]);
            Console.WriteLine(config["Student:0:age"]);

            Console.WriteLine(config["Student:1:name"]);
            Console.WriteLine(config["Student:1:age"]);

            Console.WriteLine(config["Student:2:name"]);
            Console.WriteLine(config["Student:2:age"]);


            Console.WriteLine();


            Console.Read();
        }
    }
}
